package com.iot08.api.controller;

import com.iot08.api.constant.Constant;
import com.iot08.api.service.BloodPressureRecordService;
import com.iot08.common.utils.response.ResponseEnum;
import com.iot08.common.utils.response.ResponseMap;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @Description: 对外开放的接口
 * @time: 2021/3/15 17:44
 * @author: Rock
 */
@Slf4j
@RestController
@RequestMapping("getway/open-interface")
public class ForeignController {

    @Resource
    private BloodPressureRecordService bloodPressureRecordService;

    /**
     * 获取血压计数据列表
     *
     * @param deviceNumber
     * @param timestamp
     * @param authKey
     * @param vendorCode
     * @time: 2021/3/16 10:01
     * @author: Rock
     * @version 1.0
     */
    @PostMapping("getdatalist")
    public Object list(@RequestParam String deviceNumber, @RequestParam String timestamp,
                       @RequestHeader("authKey") String authKey, @RequestHeader("vendorCode") String vendorCode) {
        return bloodPressureRecordService.listByImei(deviceNumber, timestamp, authKey, vendorCode);
    }

}
